import request from '@/utils/request'

/* 列表分页*/
export function order_page(data) {
  return request({
    url: '/sale/order/page',
    method: 'post',
    data: data
  })
}

/* 列表分页*/
export function order_list(data) {
  return request({
    url: '/sale/order/list',
    method: 'post',
    data: data
  })
}

/* 新增*/
export function order_save(data) {
  return request({
    url: '/sale/order/save',
    method: 'post',
    data: data
  })
}

/* 修改*/
export function order_update(data) {
  return request({
    url: '/sale/order/update',
    method: 'post',
    data: data
  })
}

/* 删除*/
export function order_delete(data) {
  return request({
    url: '/sale/order/delete',
    method: 'post',
    data: data
  })
}

/* 取消 */
export function order_cancel(orderId) {
  return request({
    url: '/sale/order/cancel/' + orderId,
    method: 'post'
  })
}

/* 根据订单id查询订单详情 */
export function order_detail(orderId) {
  return request({
    url: '/sale/order/' + orderId,
    method: 'post'
  })
}

/* 利润计算 */
export function order_profit_calculation(data) {
  return request({
    url: '/sale/order/profit-calculation/' + data,
    method: 'post'
  })
}

/* 查询订单状态数量 */
export function order_state_count(data) {
  return request({
    url: '/sale/order/order-state-count',
    method: 'post',
    data: data
  })
}

/* 终止订单 */
export function order_termination(data) {
  return request({
    url: '/sale/order/termination',
    method: 'post',
    data: data
  })
}
